 /*
 * @Descripttion:
 * @Author:zhengminjie,xiayujia
 * @Date: 2021-05-13 11:27:27
 * @LastEditors: xiayujia
 * @LastEditTime: 2021-06-30 11:27:28
 */
import request from '@/utils/request'
//选择群组
export function selectGroup(userIdentity){
  return request({
    url:'/distribution/personManager/select?userIdentity='+userIdentity,
    method: 'get', 
  })
} 

//获取选中群组列表
export function getGroup(groupId){
    return request({
      url:'/distribution/personManager/search?groupId='+groupId,
      method: 'get',
    })
  }  

//查看成员，获取成员列表
export function searchMember(groupId){
  return request({
    url:'/distribution/personManager/searchMI?groupId='+groupId,
    method: 'get',
  })
}  

//添加成员
export function addMember(groupNum,userName){
  return request({
    url:'/distribution/personManager/add',
    method: 'post',
    data: {
      "groupNum":groupNum,
      "userName":userName
    }
  })
}  

//删除成员
export function deleteMember(userId,groupId){
  return request({
    url:'/distribution/personManager/delete',
    method: 'post',
    data: { // 提交数据
      "userId": userId,
      "groupId":groupId
    },
  })
}  

//权限配置
export function powerConfig(userId,groupId,userIdentity,dataDistribution){
  return request({
    url:'/distribution/personManager/powerConfig',
    method: 'post',
    data: { // 提交数据
      "userId": userId,
      "groupId":groupId,
      "userIdentity":userIdentity,
      "dataDistribution":dataDistribution
    },
  })
}

//信息修改
export function editInfo(userId,groupId,groupUserName,userNumber){
  return request({
    url:'/distribution/personManager/infoModify',
    method: 'post',
    data: { // 提交数据
      "userId": userId,
      "groupId":groupId,
      "groupUserName":groupUserName,
      "userNumber":userNumber
    },
  })
}

// 下载用户导入模板
export function importTemplate() {
  return request({
    url: '/distribution/personManager/importTemplate',
    method: 'get'
  })
}

// 导出用户
export function exportMember(groupId) {
  return request({
    url: '/distribution/personManager/export?groupId='+groupId,
    method: 'get',
  })
}